build: Tie interface age to the development cycle
authorEmmanuele Bassi <ebassi@gnome.org>
Mon, 23 Nov 2020 17:58:43 +0000 (17:58 +0000)
committerEmmanuele Bassi <ebassi@gnome.org>
Wed, 9 Dec 2020 12:19:50 +0000 (12:19 +0000)
We don't want to increase the interface age manually, because we're
going to end up forgetting about it.

Instead, we should tie it to the rest of the version:

 - in stable (even minor) cycles, we don't add new API; the interface
   age is the same as the micro version
 - in unstable (odd minor) cycles, every new release might have new API,
   or updates to newly added API; keep the interface age to 0

This removes one more manual thing to change during release, and keeps
us honest with our promise not to add symbols during stable cycles.

meson.build

index 35a3b4ebd060334d33c68d2b3957c5998d946ada..26f9b8e780de28a3734c49d9809781835145062e 100644 (file)
@@ -30,15 +30,26 @@ add_project_arguments('-DG_LOG_USE_STRUCTURED=1', language: 'c')
 add_project_arguments('-DGLIB_DISABLE_DEPRECATION_WARNINGS', language: 'c')
 
 # Making releases:
-#  1. gtk_micro_version += 1;
-#  2. gtk_interface_age += 1;
-#  3. if any functions have been added, set gtk_interface_age to 0.
-#  4. if backwards compatibility has been broken, we're in trouble
+#  1. new development cycle:
+#    a. gtk_minor_version += 1
+#    b. gtk_micro_version = 0
+#  2. new stable cycle:
+#    a. gtk_minor_version += 1
+#    b. gtk_micro_version = 0
+#  3. every new release:
+#    a. gtk_micro_version += 1
 gtk_version       = meson.project_version()
 gtk_major_version = gtk_version.split('.')[0].to_int()
 gtk_minor_version = gtk_version.split('.')[1].to_int()
 gtk_micro_version = gtk_version.split('.')[2].to_int()
-gtk_interface_age = 0
+
+# Interface age gets reset during development cycles, when
+# we add new API; new micro versions of the same minor
+# stable cycle will have the same interface age
+#
+# If new API is added during a stable cycle, reset to 0
+gtk_interface_age = gtk_minor_version.is_odd() ? 0 : gtk_micro_version
+
 add_project_arguments('-DGTK_VERSION="@0@"'.format(meson.project_version()), language: 'c')
 
 add_project_arguments('-D_GNU_SOURCE', language: 'c')